package integer;

public class IntegerDemo2 {
    public static void main(String[] args) {
        //1通过包装类可以获取其对应的基本类型的取值范围
        //获取int的最大值和最小值
        int imax = Integer.MAX_VALUE;
        System.out.println(imax);
        int imin = Integer.MAX_VALUE;
        System.out.println(imin);
        /*
        Byte,Short,Integer,Long,Float,Double,Boolean,Character
         */

        long lmax = Long.MAX_VALUE;
        long lmin = Long.MAX_VALUE;
        System.out.println(lmax);
        System.out.println(lmin);

        double db = Double.MAX_VALUE;
        System.out.println(db);


        /*
        2：包装类可以将字符串分析为对应的基本类型
        */
        String s = "123";
        //String s = "123.123";//转换整数类型就会报错
        int a = Integer.parseInt(s);
        System.out.println(a);//123
        double d = Double.parseDouble(s);
        System.out.println(d);//123.0
    }
}
